import com.kuang.pojo.Student;
import com.kuang.pojo.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Mytest {
    public static void main(String[] args) {
      ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
        Student student = (Student) context.getBean("student2");


        System.out.println(student.toString());
    /*
    * Student{name='张三', address=Address{address='null'},
    *  books=[红楼梦, 西游记, 三国演义, 水浒传],
    * hobbys=[听歌, 敲代码, 看电影],
    * card={身份证=1232454321245135, 银行卡=3153465854131531},
    * games=[LOL, BOB, COC],
    * info={学号=20190000, password=123, url=nan, username=张三},
    * wife='null'}
     */
    }

    @Test
    public void test2(){
      ApplicationContext context = new ClassPathXmlApplicationContext("userbeans.xml");
        User user =context.getBean("user",User.class);
        User user2 =context.getBean("user2",User.class);
        System.out.println(user==user2);
    }
}
